package com.d3works.apps.stock.service;

import com.d3works.apps.base.db.Company;
import com.d3works.apps.base.db.Product;
import com.d3works.apps.stock.db.StockLocation;
import com.d3works.exception.D3worksException;
import com.d3works.meta.CallMethod;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;

public interface StockLocationService {

  /**
   * Get default receipt location for the given company.
   *
   * @param company
   * @return the default stock location if found, null if there was an exception or if the default
   *     location is empty
   */
  StockLocation getDefaultReceiptStockLocation(Company company);

  /**
   * Get default pickup location for the given company.
   *
   * @param company
   * @return the default stock location if found, null if there was an exception or if the default
   *     location is empty
   */
  StockLocation getPickupDefaultStockLocation(Company company);

  public BigDecimal getQty(Long productId, Long locationId, Long companyId, String qtyType)
      throws D3worksException;

  @CallMethod
  public BigDecimal getRealQty(Long productId, Long locationId, Long companyId)
      throws D3worksException;

  @CallMethod
  public BigDecimal getFutureQty(Long productId, Long locationId, Long companyId)
      throws D3worksException;

  public Map<String, Object> getStockIndicators(Long productId, Long companyId, Long locationId)
      throws D3worksException;

  @CallMethod
  public List<Long> getBadStockLocationLineId();

  @CallMethod
  public Set<Long> getContentStockLocationIds(StockLocation stockLocation);

  public List<StockLocation> getAllLocationAndSubLocation(
      StockLocation stockLocation, boolean isVirtualInclude);

  public BigDecimal getStockLocationValue(StockLocation stockLocation);

  public List<Long> getAllLocationAndSubLocationId(
      StockLocation stockLocation, boolean isVirtualInclude);

  public boolean isConfigMissing(StockLocation stockLocation, int printType);

  void changeProductLocker(StockLocation stockLocation, Product product, String newLocker)
      throws D3worksException;
}
